//
//  XMPPTool.h
//  E_ChatRoom
//
//  Created by rimi1 on 15/6/27.
//  Copyright (c) 2015年 TJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Singleton.h"
#import "XMPPFramework.h"

typedef enum {
    XMPPResultTypeLoginSuccess,//登录成功
    XMPPResultTypeLoginFailure,//登录失败
    XMPPResultTypeNetErr,//网络不给力
    XMPPResultTypeRegisterSuccess,//注册成功
    XMPPResultTypeRegisterFailure//注册失败
}XMPPResultType;

typedef void (^XMPPResultBlock)(XMPPResultType type);



@interface XMPPTool : NSObject

singleton_interface(XMPPTool)

/*唯一的XMPPStream对象, 供全局使用*/
@property (nonatomic, strong) XMPPStream *xmppStream;

/*电子名片*/
@property (nonatomic, strong) XMPPvCardTempModule *vCard;

/*聊天室*/
@property (nonatomic, strong) XMPPRoom *chatRoom;

/* 注册标识 YES 注册 / NO 登录 */
@property (nonatomic, assign,getter=isRegisterOperation) BOOL  registerOperation;//注册操作


/* 用户注销 */
-(void)xmppUserlogout;

/* 用户登录 */
-(void)xmppUserLogin:(XMPPResultBlock)resultBlock;

/* 用户注册 */
-(void)xmppUserRegister:(XMPPResultBlock)resultBlock;

/**
 *  创建聊天室
 *
 *  @param roomJid 传入一个需要创建的名字
 */
- (void)creatChatRoom:(XMPPJID *)roomJid;

@end
